<template>
  <div>
    <div class="box">
      <div class="b_l">
        <img @click="jump"
          :src="data.photos"
          alt
        />
      </div>
      <div class="b_r">
        <div class="title" @click="jump">
          <h2>{{data.name}}</h2>
        </div>
        <div class="content">
          <div class="left">
            <!-- 类型 -->
            <div class="type">
              <span>{{data.alias}}</span>
              <span v-if="data.hotellevel">
                <i v-for="(item,index) in data.hotellevel.level" :key="index" class="iconfont iconhuangguan"></i>
              </span>
              {{data.hoteltype.name}}
            </div>
            <!-- 评分 -->
            <div class="comment">
              <el-rate
                v-model="data.stars"
                disabled
                show-score
                text-color="#ff9900"
                :score-template="`${data.stars}分`"
              ></el-rate>
              <div class="conmentNum">
                <span>{{(Math.random()*100).toFixed(0)}}</span>
                条评价
              </div>
              <div class="postNum">
                <span>{{(Math.random()*100).toFixed(0)}}</span>
                篇游记
              </div>
            </div>
            <!-- 定位 -->
            <div class="positioning">
              <i class="iconfont">&#xe611;</i>
              位于: {{data.address}}
            </div>
          </div>
          <div class="right">
            <a href="https://hotels.ctrip.com/hotel/694679.html">
              <div class="item" v-for="(item,index) in data.products" :key="index">
              <div class="item_l">{{item.name}}</div>
              <div class="item_r">
                <span>￥{{item.price}}</span>起
                <i class="el-icon-arrow-right"></i>
              </div>
            </div>
            </a>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props:['data'],
  methods: {
    jump(){
      this.$router.push('/hotel/details?id='+this.data.id)
    }
  },
}
</script>
<style lang="less" scoped>
.box {
  border-bottom: 1px solid #ddd;
  padding:25px 0;
  display: flex;
  .b_l {
    margin-right: 20px;
    img {
      cursor: pointer;
      width: 320px;
      height: 210px;
    }
  }
  .b_r {
    .title {
      h2 {
        cursor: pointer;
        font-weight: 400;
      }
    }
    .content {
      display: flex;
      line-height: 2;
      .left {
        width: 402px;
        .type {
          color: #999;
          display: flex;
          flex-wrap: wrap;
          span {
            display: flex;
            margin-right: 5px;
            align-items: center;
            i {
              color: #ff9900;
            }
          }
        }
        .comment {
          display: flex;
          align-items: center;
          div {
            margin-right: 35px;
            span {
              color: #ffa600;
            }
          }
        }
        .positioning {
          font-size: 14px;
          color: #666;
        }
      }
      .right {
        width: 255px;
        padding-left: 30px;
        .item {
          cursor: pointer;
          font-size: 14px;
          color: #666;
          display: flex;
          justify-content: space-between;
          padding: 0 30px 0 10px;
          height: 50px;
          align-items: center;
          border-bottom: 1px solid #ddd;
          &:hover {
            background: #f5f7fa;
          }
          span {
            color: #ff9900;
            font-size: 18px;
          }
        }
      }
    }
  }
}
</style>